package com.jxd.project.travel.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jxd.project.travel.model.Ticket;

import java.util.List;

public interface ITicketService extends IService<Ticket> {
    IPage<Ticket> getTicketList(int pageNum, int pageSize, String departure, String arrival , int empno);
    boolean insertTicket(Ticket ticket);
    boolean updateTicket(Ticket ticket);
    boolean deleteTicket(int ticketId);
    boolean deleteTicketBatch(List<Integer> ticketIds);

    //查询未绑定车票和已选车票
    List<Ticket> getTicketByEmpno(Integer empno, String travelId);
    //删除差旅信息时，只删除关联的票据信息中的差旅编号信息，不删除票据信息本身
    boolean deleteTravelIdInTicket(List<String> travelId);
    //计算同一差旅中的票据总价
    double getAllTicketPrice(int[] ticketIds);

    // 重置旧车票的travelId为0
    boolean resetTravelIdInTicket(String travelId);

    //绑定车票所对应的差旅信息
    List<Ticket> setTravelId(String travelId, int[] ticketIds);

    //通过车票List最早开始时间和最晚结束时间，计算出差旅时间
    double getTravelTime(List<Ticket> tickets);

    //修改票据时获取票据信息
    Ticket getOne(int ticketId);

    //获取最新票据信息
    Ticket getLastTicket(int empno);



}
